
<form method="post" action="/<?=$this->load->controller()?>/save" class="edit">
	
	<div class="legend"><h3><?=$this->load->method()?></h3></div>
		
	<?	foreach ($data['update'] as $id => $update): ?>
	
		<div class="itemid"><?=$id?></div>
		
		<ul class="list">
	
			<? foreach ($data['campos'] as $k => $field): ?>
			
					<?
					
						$field['fieldname'] = "data[form][".$id."][data][".$field['Field']."]";
						$field['fieldvalue'] = $update[$field['Field']];

						// Si es checkbox, el value lo hago array
						if ($field['Tag'] == 'checkbox')
							$field['fieldvalue'] = (array)explode(',', $field['fieldvalue']);
					
					?>
					
					<li>
						<?=$this->load->view('scaffold/components/form/'.$field['Tag'], array('field' => $field));?>
					</li>
	
			<? endforeach; ?>
		
		</ul>
	
	<?	endforeach; ?>
		
	<div class="submits">
	
		<button type="submit" name="action" value="<?=$this->load->method()?>" class="capitalize button"><?=$this->load->method()?></button>
		
	</div>

</form>

<!--<div class="page-curl"></div>-->

